package com.project.systemfront.service.impl;

import com.project.systemfront.mapper.FroNoticeMapper;
import com.project.systemfront.pojo.FroNotice;
import com.project.systemfront.service.IFroNoticeService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * 通知公告Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-01-20
 */
@Service
public class FroNoticeServiceImpl implements IFroNoticeService
{
    @Autowired
    private FroNoticeMapper froNoticeMapper;

    /**
     * 查询通知公告
     * 
     * @param noticeId 通知公告主键
     * @return 通知公告
     */
    @Override
    public FroNotice selectFroNoticeByNoticeId(Long noticeId)
    {
        return froNoticeMapper.selectFroNoticeByNoticeId(noticeId);
    }

    /**
     * 查询通知公告列表
     * 
     * @param froNotice 通知公告
     * @return 通知公告
     */
    @Override
    public List<FroNotice> selectFroNoticeList(FroNotice froNotice)
    {
        return froNoticeMapper.selectFroNoticeList(froNotice);
    }

    /**
     * 新增通知公告
     * 
     * @param froNotice 通知公告
     * @return 结果
     */
    @Override
    public int insertFroNotice(FroNotice froNotice)
    {
        froNotice.setCreateTime(new Date());
        return froNoticeMapper.insertFroNotice(froNotice);
    }

    /**
     * 修改通知公告
     * 
     * @param froNotice 通知公告
     * @return 结果
     */
    @Override
    public int updateFroNotice(FroNotice froNotice)

    {
        froNotice.setUpdateTime(new Date());
        return froNoticeMapper.updateFroNotice(froNotice);
    }

    /**
     * 批量删除通知公告
     * 
     * @param noticeIds 需要删除的通知公告主键
     * @return 结果
     */
    @Override
    public int deleteFroNoticeByNoticeIds(Long[] noticeIds)
    {
        return froNoticeMapper.deleteFroNoticeByNoticeIds(noticeIds);
    }

    /**
     * 删除通知公告信息
     * 
     * @param noticeId 通知公告主键
     * @return 结果
     */
    @Override
    public int deleteFroNoticeByNoticeId(Long noticeId)
    {
        return froNoticeMapper.deleteFroNoticeByNoticeId(noticeId);
    }
}
